
package server.skill;


import client.MapleCharacter;
import client.inventory.MapleInventoryType;
import kotlin.Metadata;
import kotlin.collections.CollectionsKt;
import kotlin.jvm.internal.Intrinsics;
import org.jetbrains.annotations.NotNull;
import provider.MapleData;
import provider.MapleDataProviderFactory;
import provider.MapleDataTool;
import server.MapleStatEffect;
import server.MapleStatEffectFactory;
import server.life.MapleMonster;
import tools.Randomizer;

import java.awt.*;
import java.io.File;
import java.util.*;
import java.util.List;


public class MapleForceAtomFactory {
    private MapleForceAtomFactory() {
        /*  24 */     initialize();
           }
    static {
        /*  22 */
        INSTANCE = new MapleForceAtomFactory();

        forceAtoms = new HashMap<>();
    }

    /*  24 */   public static  HashMap<Integer, Map<Integer, ForceAtomDataEntry>> forceAtoms;

       public static MapleForceAtomFactory INSTANCE;

    public final void initialize() {
        /*  30 */
        forceAtoms = new HashMap<>();
        /*  31 */
        MapleData characterEff = MapleDataProviderFactory.getDataProvider(new File(System.getProperty("wzpath") + "/Effect.wz")).getData("CharacterEff.img");
        /*  32 */
        Iterator<MapleData> forceAtomIt = characterEff.getChildByPath("forceAtom").iterator();
        /*  33 */
        while (forceAtomIt.hasNext()) {
            /*  34 */
            MapleData forceAtom = forceAtomIt.next();
            /*  35 */
            String str = forceAtom.getName();
            int name = Integer.parseInt(str);
            /*  36 */
            int firstImpactMin = 45;
            /*  37 */
            int firstImpactMax = 50;
            /*  38 */
            int secondImpactMin = 30;
            /*  39 */
            int secondImpactMax = 35;
            /*  40 */
            MapleData infoData = forceAtom.getChildByPath("info");
            /*  41 */
            if (infoData != null) {
                /*  42 */
                firstImpactMin = MapleDataTool.getInt(infoData.getChildByPath("firstImpactMin"), 45);
                /*  43 */
                firstImpactMax = MapleDataTool.getInt(infoData.getChildByPath("firstImpactMax"), 50);
                /*  44 */
                secondImpactMin = MapleDataTool.getInt(infoData.getChildByPath("secondImpactMin"), 30);
                /*  45 */
                secondImpactMax = MapleDataTool.getInt(infoData.getChildByPath("secondImpactMax"), 35);

            }
            /*  47 */
            MapleData atomData = forceAtom.getChildByPath("atom");
            /*  48 */
            if (atomData != null) {
                /*  49 */
                HashMap<Integer, ForceAtomDataEntry> infos = new HashMap();
                /*  50 */
                Iterator<MapleData> atomIt = atomData.iterator();
                /*  51 */
                while (atomIt.hasNext()) {
                    /*  52 */
                    MapleData info = atomIt.next();
                    /*  53 */
                    if (info.getName().length() <= 2) {
                        /*  54 */
                        String str1 = info.getName();
                        int atomName = Integer.parseInt(str1);
                        /*  55 */
                        ArrayList<Point> startPoints = new ArrayList();
                        /*  56 */
                        MapleData startInfoData = info.getChildByPath("startInfo");
                        /*  57 */
                        if (startInfoData != null) {
                            /*  58 */
                            MapleDataTool.getInt(startInfoData.getChildByPath("startYmin"), 0);
                            /*  59 */
                            MapleDataTool.getInt(startInfoData.getChildByPath("startYmax"), 0);
                            /*  60 */
                            MapleDataTool.getInt(startInfoData.getChildByPath("arriveTime"), 0);
                            /*  61 */
                            MapleDataTool.getInt(startInfoData.getChildByPath("updownYmin"), 0);
                            /*  62 */
                            MapleDataTool.getInt(startInfoData.getChildByPath("updownYmax"), 0);
                            /*  63 */
                            MapleDataTool.getInt(startInfoData.getChildByPath("updownTimeMin"), 0);
                            /*  64 */
                            MapleDataTool.getInt(startInfoData.getChildByPath("updownTimeMax"), 0);

                        }
                        /*  66 */
                        MapleDataTool.getInt(info.getChildByPath("isHoming"), 0);
                        /*  67 */
                        MapleDataTool.getInt(info.getChildByPath("holdRotate"), 0);
                        /*  68 */
                        MapleData startPointData = info.getChildByPath("startPoint");
                        /*  69 */
                        if (startPointData != null) {
                            /*  70 */
                            startPoints = new ArrayList();
                            /*  71 */
                            Iterator<MapleData> startPointIt = startPointData.iterator();
                            /*  72 */
                            while (startPointIt.hasNext()) {
                                /*  73 */
                                MapleData nextPointData = startPointIt.next();
                                /*  74 */
                                int i = 0;
                                /*  75 */
                                while (nextPointData.getChildByPath(String.valueOf(i)) != null) {
                                    /*  76 */
                                    Point point = MapleDataTool.getPoint(nextPointData.getChildByPath(String.valueOf(i)));
                                    /*  77 */
                                    if (point != null) {
                                        /*  78 */
                                        startPoints.add(point);

                                    }
                                    /*  80 */
                                    i++;

                                }

                            }

                        }
                        /*  84 */
                        ForceAtomDataEntry forceAtomEntry = new ForceAtomDataEntry();
                        /*  85 */
                        forceAtomEntry.setStartPoint(startPoints);
                        /*  86 */
                        forceAtomEntry.setFirstImpactMin(firstImpactMin);
                        /*  87 */
                        forceAtomEntry.setFirstImpactMax(firstImpactMax);
                        /*  88 */
                        forceAtomEntry.setSecondImpactMin(secondImpactMin);
                        /*  89 */
                        forceAtomEntry.setSecondImpactMax(secondImpactMax);
                        /*  90 */
                        infos.put(Integer.valueOf(atomName), forceAtomEntry);

                    }

                }
                /*  93 */
                forceAtoms.put(Integer.valueOf(name), infos);

            }

        }

    }


     public final MapleForceAtom create恶魔精气ForceAtom( MapleCharacter player,  MapleStatEffect effect, int forceOID, int color) {
        /*  99 */
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(effect, "effect");
        MapleForceAtom forceAtom = new MapleForceAtom();
        /* 100 */
        forceAtom.setFrom((forceOID > 0));
        /* 101 */
        forceAtom.setOwnerID(player.getId());
        /* 102 */
        Intrinsics.checkExpressionValueIsNotNull(player.getPosition(), "player.position");
        forceAtom.setPoint(player.getPosition());
        /* 103 */
        forceAtom.setToMobOIDs(CollectionsKt.emptyList());
        /* 104 */
        forceAtom.setToMobOID(0);
        /* 105 */
        forceAtom.setFromMobOID(forceOID);
        /* 106 */
        forceAtom.setType(0);
        /* 107 */
        Intrinsics.checkExpressionValueIsNotNull(player.getPosition(), "player.position");
        forceAtom.setForceAtomEntry(createForceList(player, effect, 1, forceAtom.getType(), color, 30, 65, 0, player.getPosition()));

        /* 109 */
        return forceAtom;

    }


     public final MapleForceAtom createForceAtom( MapleCharacter player,  MapleStatEffect effect, int forceOID, int fromMobOID, int toMobOID) {
        /* 113 */
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(effect, "effect");
        Intrinsics.checkExpressionValueIsNotNull(player.getPosition(), "player.position");
        return createForceAtom(player, effect, forceOID, fromMobOID, toMobOID, CollectionsKt.emptyList(), player.getPosition());

    }

     public final MapleForceAtom createForceAtom( MapleCharacter player,  MapleStatEffect effect,  List<Integer> toMobOIDs) {
        /* 116 */
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(effect, "effect");
        Intrinsics.checkParameterIsNotNull(toMobOIDs, "toMobOIDs");
        Intrinsics.checkExpressionValueIsNotNull(player.getPosition(), "player.position");
        return createForceAtom(player, effect, 0, toMobOIDs, player.getPosition());

    }
     public final MapleForceAtom createForceAtom( MapleCharacter player,  MapleStatEffect effect, int forceOID) {
        /* 119 */
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(effect, "effect");
        Intrinsics.checkExpressionValueIsNotNull(player.getPosition(), "player.position");
        return createForceAtom(player, effect, forceOID, CollectionsKt.emptyList(), player.getPosition());

    }

     public final MapleForceAtom createForceAtom( MapleCharacter player,  MapleStatEffect effect, int forceOID, int y) {
        /* 122 */
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(effect, "effect");
        Intrinsics.checkExpressionValueIsNotNull(player.getPosition(), "player.position");
        return createForceAtom(player, effect, forceOID, y, 0, CollectionsKt.emptyList(), player.getPosition());

    }
     public final MapleForceAtom createForceAtom( MapleCharacter player,  MapleStatEffect effect, int forceOID,  List<Integer> toMobOIDs,  Point point) {
        /* 125 */
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(effect, "effect");
        Intrinsics.checkParameterIsNotNull(toMobOIDs, "toMobOIDs");
        Intrinsics.checkParameterIsNotNull(point, "point");
        return createForceAtom(player, effect, 1, forceOID, 0, toMobOIDs, point);

    }

    private final MapleForceAtom createForceAtom(MapleCharacter player, MapleStatEffect effect, int forceOID, int fromMobOID, int toMobOID, List<Integer> toMobOIDs, Point point) {

        int mobcount;
        /* 128 */
        MapleForceAtom forceAtom = new MapleForceAtom();
        /* 129 */
        forceAtom.setFrom((fromMobOID > 0));
        /* 130 */
        forceAtom.setOwnerID(player.getId());
        /* 131 */
        forceAtom.setPoint(point);
        /* 132 */
        forceAtom.setToMobOIDs(toMobOIDs);
        /* 133 */
        switch (effect.getSourceid()) {

            case 2121052:
                /* 135 */
                forceAtom.setFromMobOID(0);
                /* 136 */
                forceAtom.setType(3);
                /* 137 */
                forceAtom.setToMobOID(0);
                /* 138 */
                forceAtom.setSkillID(2121055);
                /* 139 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 2, 20, 50, 500, point));
                break;

            case 3100010:
            case 3101009:

            case 3121016:
                /* 142 */
                forceAtom.setFromMobOID(0);
                /* 143 */
                forceAtom.setType(10);
                /* 144 */
                forceAtom.setToMobOID(toMobOID);
                /* 145 */
                forceAtom.setSkillID((effect.getSourceid() == 3121016) ? 3120017 : 3100010);
                /* 146 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 20, 50, 53, point));
                break;

            case 4100011:

            case 4101011:
                /* 149 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 150 */
                forceAtom.setType(11);
                /* 151 */
                forceAtom.setToMobOID(0);
                /* 152 */
                forceAtom.setSkillID(4100012);
                /* 153 */
                Intrinsics.checkExpressionValueIsNotNull(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0), "MapleStatEffectFactory.c…100), Point(100, 100), 0)");
                forceAtom.setRectangle(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0));
                /* 154 */
                player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel());
                forceAtom.setCosumeItemID((player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel()) != null) ? player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel()).getItemId() : 0);
                /* 155 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 40, 100, 200, point));

                break;

            case 4120018:
                /* 158 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 159 */
                forceAtom.setType(11);
                /* 160 */
                forceAtom.setToMobOID(0);
                /* 161 */
                forceAtom.setSkillID(4120019);
                /* 162 */
                Intrinsics.checkExpressionValueIsNotNull(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0), "MapleStatEffectFactory.c…100), Point(100, 100), 0)");
                forceAtom.setRectangle(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0));
                /* 163 */
                player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel());
                forceAtom.setCosumeItemID((player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel()) != null) ? player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel()).getItemId() : 0);
                /* 164 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 2, 40, 100, 200, point));

                break;

            case 12001020:
                /* 167 */
                forceAtom.setSkillID(12000026);
                /* 168 */
                forceAtom.setType(17);
                /* 169 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 40, 100, 30, point));

                break;

            case 12100020:
                /* 172 */
                forceAtom.setSkillID(12100028);
                /* 173 */
                forceAtom.setType(17);
                /* 174 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 2, 40, 100, 30, point));

                break;

            case 12110020:
                /* 177 */
                forceAtom.setSkillID(12110028);
                /* 178 */
                forceAtom.setType(17);
                /* 179 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 3, 40, 100, 30, point));

                break;

            case 12120006:
                /* 182 */
                forceAtom.setSkillID(12120010);
                /* 183 */
                forceAtom.setType(17);
                /* 184 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 4, 25, 100, 30, point));
                break;

            case 13101022:
            case 13110022:

            case 13120003:
                /* 187 */
                forceAtom.setType(7);
                /* 188 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 189 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 42, Randomizer.isSuccess(50) ? 50 : 180, 40, point));
                break;

            case 13100027:
            case 13110027:

            case 13120010:
                /* 192 */
                forceAtom.setType(7);
                /* 193 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 194 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 2, 42, Randomizer.isSuccess(50) ? 50 : 180, 40, point));

                break;

            case 13121054:
                /* 197 */
                forceAtom.setType(8);
                /* 198 */
                forceAtom.setToMobOID(toMobOID);
                /* 199 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 200 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 15, player.isFacingLeft() ? 90 : 280, 60, point));
                break;

            case 14000027:

            case 14000028:
                /* 203 */
                forceAtom.setType(forceAtom.isFrom() ? 16 : 15);
                /* 204 */
                forceAtom.setSkillID(14000028);
                /* 205 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 206 */
                forceAtom.setToMobOID(toMobOID);
                /* 207 */
                Intrinsics.checkExpressionValueIsNotNull(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0), "MapleStatEffectFactory.c…100), Point(100, 100), 0)");
                forceAtom.setRectangle(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0));
                /* 208 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), forceAtom.isFrom() ? 1 : 2, 32, 280, forceAtom.isFrom() ? 30 : 300, point));
                break;

            case 400041009:

            case 400041010:
                /* 211 */
                forceAtom.setType(1);
                /* 212 */
                forceAtom.setToMobOID(toMobOID);
                /* 213 */
                forceAtom.setSkillID(400041010);
                /* 214 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 2, 35, 7, 60, point));
                break;

            case 24100003:

            case 24120002:
                /* 217 */
                forceAtom.setType(1);
                /* 218 */
                forceAtom.setToMobOID(toMobOID);
                /* 219 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 220 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), (effect.getSourceid() == 24120002) ? 2 : 1, 25, 7, 60, point));
                break;

            case 20031209:

            case 20031210:
                /* 223 */
                forceAtom.setType(1);
                /* 224 */
                forceAtom.setToMobOID(toMobOID);
                /* 225 */
                forceAtom.setSkillID((effect.getSourceid() == 20031210) ? 24120002 : 24100003);
                /* 226 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), (effect.getSourceid() == 20031210) ? 2 : 1, 25, 7, 60, point));

                break;







            case 25100009:

            case 25120110:
                /* 236 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 237 */
                forceAtom.setType(forceAtom.isFrom() ? 4 : 13);
                /* 238 */
                forceAtom.setToMobOID(toMobOID);
                /* 239 */
                forceAtom.setSkillID((effect.getSourceid() == 25100009) ? 25100010 : 25120115);
                /* 240 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), (effect.getSourceid() == 25100009) ? (forceAtom.isFrom() ? 4 : 1) : (forceAtom.isFrom() ? 5 : 2), 25, player.isFacingLeft() ? 90 : 280, 60, point));

                break;








            case 400021069:
                /* 250 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 251 */
                forceAtom.setType(29);
                /* 252 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 253 */
                Intrinsics.checkExpressionValueIsNotNull(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0), "MapleStatEffectFactory.c…100), Point(100, 100), 0)");
                forceAtom.setRectangle(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0));
                /* 254 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 4, 30, 65, 0, point));
                break;

            case 31221001:

            case 31221014:
                /* 257 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 258 */
                forceAtom.setType(forceAtom.isFrom() ? 4 : 3);
                /* 259 */
                forceAtom.setToMobOID(toMobOID);
                /* 260 */
                forceAtom.setSkillID(31221014);
                /* 261 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 3, forceAtom.isFrom() ? 80 : 20, player.isFacingLeft() ? Randomizer.rand(30, 90) : Randomizer.rand(200, 280), forceAtom.isFrom() ? 60 : 500, point));
                break;

            case 35101002:

            case 35110017:
                /* 264 */
                forceAtom.setType(20);
                /* 265 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 266 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), (effect.getSourceid() == 35101002) ? 0 : 2, 37, player.isFacingLeft() ? 90 : 280, 512, point));

                break;

            case 36111004:
                /* 269 */
                forceAtom.setType(5);
                /* 270 */
                forceAtom.setSkillID(36110004);
                /* 271 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 272 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 35, 96, 256, point));

                break;

            case 36001005:
                /* 275 */
                forceAtom.setType(6);
                /* 276 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 277 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 20, 34, 0, point));
                break;

            case 61101002:
            case 61120007:

            case 400011058:
                /* 280 */
                forceAtom.setType(2);
                /* 281 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 282 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 2, 16, player.isFacingLeft() ? 90 : 280, 16, point));
                break;

            case 61110211:
            case 61121217:

            case 400011059:
                /* 285 */
                forceAtom.setType(2);
                /* 286 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 287 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 3, 16, player.isFacingLeft() ? 90 : 280, 16, point));
                break;

            case 65111007:
            case 65111100:

            case 65121011:
                /* 290 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 291 */
                forceAtom.setType(forceAtom.isFrom() ? 4 : 3);
                /* 292 */
                forceAtom.setToMobOID(toMobOID);
                /* 293 */
                forceAtom.setSkillID(65111007);
                /* 294 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, forceAtom.isFrom() ? 32 : 16, player.isFacingLeft() ? 90 : 280, forceAtom.isFrom() ? 32 : 300, point));

                break;

            case 142110011:
                /* 297 */
                forceAtom.setType(22);
                /* 298 */
                forceAtom.setToMobOID(toMobOID);
                /* 299 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 300 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 18, player.isFacingLeft() ? 90 : 280, 300, point));

                break;

            case 400021001:
                /* 303 */
                forceAtom.setType(28);
                /* 304 */
                forceAtom.setToMobOID(toMobOID);
                /* 305 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 306 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 36, player.isFacingLeft() ? 30 : 50, 528, point));
                break;

            case 400051007:

            case 400051013:
                /* 309 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 310 */
                forceAtom.setType(27);
                /* 311 */
                forceAtom.setToMobOID(toMobOID);
                /* 312 */
                forceAtom.setSkillID(400051013);
                /* 313 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), forceAtom.isFrom() ? 4 : 1, 25, player.isFacingLeft() ? 10 : 15, 0, point));

                break;

            case 400031020:
                /* 316 */
                forceAtom.setFromMobOID(0);
                /* 317 */
                forceAtom.setType(31);
                /* 318 */
                forceAtom.setToMobOID(toMobOID);
                /* 319 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 320 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 20, 70, 53, point));
                break;

            case 400041022:

            case 400041023:
                /* 323 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 324 */
                forceAtom.setType(33);
                /* 325 */
                forceAtom.setToMobOID(toMobOID);
                /* 326 */
                forceAtom.setSkillID(400041023);
                /* 327 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 32, 70, 70, (fromMobOID == 0) ? 760 : 0, point));

                break;

            case 400031022:
                /* 330 */
                forceAtom.setType(34);
                /* 331 */
                forceAtom.setToMobOID(toMobOID);
                /* 332 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 333 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 36, player.isFacingLeft() ? 30 : 50, 528, point));

                break;

            case 400051017:
                /* 336 */
                forceAtom.setType(30);
                /* 337 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 338 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 48, 37, 1440, point));

                break;

            case 400031000:
                /* 341 */
                forceAtom.setType(27);
                /* 342 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 343 */
                Intrinsics.checkExpressionValueIsNotNull(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0), "MapleStatEffectFactory.c…100), Point(100, 100), 0)");
                forceAtom.setRectangle(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0));
                /* 344 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 48, 90, 840, point));

                break;






            case 152120017:
                /* 352 */
                forceAtom.setType(41);
                /* 353 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 354 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 48, 8, 310, point));

                break;







            case 152110004:
                /* 363 */
                forceAtom.setType(37);
                /* 364 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 365 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 2, 50, 390, point));
                break;

            case 80011585:
            case 80011586:
            case 80011587:
            case 80011588:
            case 80011589:
            case 80011590:

            case 80011635:
                /* 368 */
                forceAtom.setType(17);
                /* 369 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 370 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 2, 16, player.isFacingLeft() ? 90 : 280, 16, point));

                break;

            case 400021044:

            case 400021045:
                /* 374 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 375 */
                forceAtom.setType(3);
                /* 376 */
                forceAtom.setToMobOID(toMobOID);
                /* 377 */
                forceAtom.setSkillID(400021045);
                /* 378 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 6, 10, 70, 90, point));

                break;

            case 155121003:
                /* 381 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 382 */
                forceAtom.setType(46);
                /* 383 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 384 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 10, 70, 900 + Randomizer.nextInt(10), point));

                break;

            case 155111003:
                /* 387 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 388 */
                forceAtom.setType(45);
                /* 389 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 390 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 10, 70, 900 + Randomizer.nextInt(10), point));

                break;

            case 155101002:
                /* 393 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 394 */
                forceAtom.setType(44);
                /* 395 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 396 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 10, 70, 900 + Randomizer.nextInt(10), point));

                break;

            case 155001000:
                /* 399 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 400 */
                forceAtom.setType(43);
                /* 401 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 402 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 10, 70, 900 + Randomizer.nextInt(10), point));

                break;

            case 155100009:
                /* 405 */
                forceAtom.setType(47);
                /* 406 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 407 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 3, Randomizer.rand(160, 172), 300, point));

                break;

            case 155111207:
                /* 410 */
                forceAtom.setType(48);
                /* 411 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 412 */
                createForceList(player, effect, forceOID, forceAtom.getType(), 0, 41, 0, 0, point);

                break;

            case 400041038:
                /* 415 */
                forceAtom.setType(49);
                /* 416 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 417 */
                Intrinsics.checkExpressionValueIsNotNull(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0), "MapleStatEffectFactory.c…100), Point(100, 100), 0)");
                forceAtom.setRectangle(MapleStatEffectFactory.calculateBoundingBox(point, true, new Point(-120, -100), new Point(100, 100), 0));
                /* 418 */
                player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel());
                forceAtom.setCosumeItemID((player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel()) != null) ? player.getInventory(MapleInventoryType.USE).getDartsSlot(player.getLevel()).getItemId() : 0);
                /* 419 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 2, 36, player.isFacingLeft() ? 30 : 50, 528, point));
                break;

            case 3011004:
            case 3300002:

            case 3321003:
                /* 422 */
                forceAtom.setType(56);
                /* 423 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 424 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 29, 174, 60, point, toMobOIDs.size()));

                break;

            case 3301008:
                /* 427 */
                forceAtom.setType(58);
                /* 428 */
                forceAtom.setSkillID(3301009);
                /* 429 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 430 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 29, 335, 120, point, toMobOIDs.size()));

                break;

            case 42110002:
                /* 433 */
                forceAtom.setType(59);
                /* 434 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 435 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 436 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 58, 138, Randomizer.rand(749, 882), point));

                break;

            case 164101004:
                /* 439 */
                forceAtom.setType(60);
                /* 440 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 441 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 442 */
                mobcount = player.hasBuffSkill(400041048) ? player.getSkillEffect(400041049).getBulletCount(player) : effect.getBulletCount(player);
                /* 443 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 1, 44, 80, 60, point, mobcount));

                break;

            case 164120007:
                /* 446 */
                forceAtom.setType(61);
                /* 447 */
                forceAtom.setSkillID(effect.getSourceid());
                /* 448 */
                forceAtom.setFromMobOID(fromMobOID);
                /* 449 */
                forceAtom.setToMobOID(toMobOID);
                /* 450 */
                forceAtom.setForceAtomEntry(createForceList(player, effect, forceOID, forceAtom.getType(), 0, 44, 352, 0, point, toMobOIDs.size()));

                break;

        }
        /* 453 */
        return forceAtom;

    }



    private final List<ForceAtomEntry> createForceList(MapleCharacter player, MapleStatEffect effect, int forceOID, int type, int color, int u, int v, int w, Point point) {
        /* 457 */
        ArrayList<ForceAtomEntry> ret = new ArrayList();
        /* 458 */
        Map forceAtomData = forceAtoms.get(Integer.valueOf(type));
        /* 459 */
        if (forceAtomData != null) {
            /* 460 */
            ForceAtomDataEntry entry = (ForceAtomDataEntry) forceAtomData.get(Integer.valueOf(Math.min(forceAtomData.size(), color + 1)));
            /* 461 */
            if (entry != null) {


                /* 464 */
                byte b = 1;
                int i = effect.getBulletCount(player);
                if (b <= i)
                    /* 465 */ while (true) {
                    ForceAtomEntry forceAtomEntry = new ForceAtomEntry(0, 0, 0, 0, 0, 0, null, 0L, 0, 0, null);
                    /* 466 */
                    forceAtomEntry.setOid(player.getMap().getSpawnedForcesOnMap() * 100 + forceOID);
                    /* 467 */
                    forceAtomEntry.setColor(color);

                    /* 469 */
                    forceAtomEntry.setFirstImpactMin((effect.getSourceid() == 164101004 || effect.getSourceid() == 36111004) ? u : Randomizer.rand(u - 6, u));
                    /* 470 */
                    forceAtomEntry.setFirstImpactMax(Randomizer.rand(entry.getSecondImpactMin(), entry.getSecondImpactMax()));
                    /* 471 */
                    forceAtomEntry.setSecondImpactMin(Randomizer.rand(v - 20, v));
                    /* 472 */
                    forceAtomEntry.setSecondImpactMax(w);
                    /* 473 */
                    Point point2 = new Point();
                    /* 474 */
                    if (effect.getSourceid() == 42110002) {
                        /* 475 */
                        forceAtomEntry.setFirstImpactMax(Randomizer.rand(15, 16));

                    }









                    /* 486 */
                    if (effect.getSourceid() == 400051017 || effect.getSourceid() == 400021001 || effect.getSourceid() == 400031022) {
                        /* 487 */
                        point2.x = Randomizer.rand(-600 + (player.getPosition()).x, 600 + (player.getPosition()).x);
                        /* 488 */
                        point2.y = Randomizer.rand(-300 + (player.getPosition()).y, 50 + (player.getPosition()).y);

                    }
                    /* 490 */
                    if (effect.getSourceid() == 400031000) {
                        /* 491 */
                        forceAtomEntry.setFirstImpactMin(43);
                        /* 492 */
                        forceAtomEntry.setFirstImpactMax(3);
                        /* 493 */
                        forceAtomEntry.setSecondImpactMin(90);

                    }
                    /* 495 */
                    forceAtomEntry.setPoint(point2);
                    /* 496 */
                    forceAtomEntry.setCreatTime(System.currentTimeMillis());
                    /* 497 */
                    forceAtomEntry.setMobCount(effect.getMobCount());
                    /* 498 */
                    forceAtomEntry.setY(0);
                    /* 499 */
                    ret.add(forceAtomEntry);
                    if (b != i) {
                        b++;
                        continue;
                    }

                    break;
                }


            }
            /* 503 */
        }
        return ret;

    }






    private final List<ForceAtomEntry> createForceList(MapleCharacter player, MapleStatEffect effect, int forceOID, int type, int color, int u, int v, int w, Point point, int mobcount) {
        /* 510 */
        ArrayList<ForceAtomEntry> ret = new ArrayList();
        /* 511 */
        Map forceAtomData = forceAtoms.get(Integer.valueOf(type));
        /* 512 */
        if (forceAtomData != null) {
            /* 513 */
            ForceAtomDataEntry entry = (ForceAtomDataEntry) forceAtomData.get(Integer.valueOf(Math.min(forceAtomData.size(), color + 1)));
            /* 514 */
            if (entry != null) {


                /* 517 */
                byte b = 1;
                int i = mobcount;
                if (b <= i)
                    /* 518 */ while (true) {
                    ForceAtomEntry forceAtomEntry = new ForceAtomEntry(0, 0, 0, 0, 0, 0, null, 0L, 0, 0, null);
                    /* 519 */
                    forceAtomEntry.setOid(player.getMap().getSpawnedForcesOnMap() * 100 + forceOID);

                    /* 521 */
                    forceAtomEntry.setColor((effect.getSourceid() == 164120007) ? (color + b) : color);

                    /* 523 */
                    forceAtomEntry.setFirstImpactMin((effect.getSourceid() == 164101004) ? u : Randomizer.rand(u - 6, u));
                    /* 524 */
                    forceAtomEntry.setFirstImpactMax(Randomizer.rand(entry.getSecondImpactMin(), entry.getSecondImpactMax()));
                    /* 525 */
                    forceAtomEntry.setSecondImpactMin(Randomizer.rand(v - 20, v));
                    /* 526 */
                    forceAtomEntry.setSecondImpactMax(w);
                    /* 527 */
                    Point point2 = new Point();









                    /* 537 */
                    if (effect.getSourceid() == 400051017 || effect.getSourceid() == 400021001 || effect.getSourceid() == 400031022) {
                        /* 538 */
                        point2.x = Randomizer.rand(-600 + (player.getPosition()).x, 600 + (player.getPosition()).x);
                        /* 539 */
                        point2.y = Randomizer.rand(-300 + (player.getPosition()).y, 50 + (player.getPosition()).y);

                    }
                    /* 541 */
                    if (effect.getSourceid() == 400031000) {
                        /* 542 */
                        forceAtomEntry.setFirstImpactMin(43);
                        /* 543 */
                        forceAtomEntry.setFirstImpactMax(3);
                        /* 544 */
                        forceAtomEntry.setSecondImpactMin(90);

                    }
                    /* 546 */
                    forceAtomEntry.setPoint(point2);
                    /* 547 */
                    forceAtomEntry.setCreatTime(System.currentTimeMillis());
                    /* 548 */
                    forceAtomEntry.setMobCount(effect.getMobCount());
                    /* 549 */
                    forceAtomEntry.setY(0);
                    /* 550 */
                    ret.add(forceAtomEntry);
                    if (b != i) {
                        b++;
                        continue;
                    }

                    break;
                }


            }
            /* 554 */
        }
        return ret;

    }


    
     public final List<ForceAtomEntry> createForceList( MapleCharacter player,  List list, int x) {
        ForceAtomDataEntry entry;

        Iterator iterator;
        /* 559 */
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(list, "list");
        ArrayList<ForceAtomEntry> ret = new ArrayList();
        /* 560 */
        Map forceAtomData = forceAtoms.get(Integer.valueOf(12));
        /* 561 */
        if (forceAtomData != null)
            /* 562 */ {
            entry = (ForceAtomDataEntry) forceAtomData.get(Integer.valueOf(Math.min(forceAtomData.size(), 2)));
            /* 563 */
            if (entry != null)
                /* 564 */ {
                Iterable $receiver$iv = list;

                iterator = $receiver$iv.iterator();
            } else {
                return ret;
            }
        } else {
            return ret;
        }
        if (iterator.hasNext()) {
            Object element$iv = iterator.next();
            MapleMonster mob = (MapleMonster) element$iv;
            MapleForceAtomFactory mapleForceAtomFactory1 = INSTANCE, $receiver = mapleForceAtomFactory1;
            ForceAtomEntry forceAtomEntry = new ForceAtomEntry(0, 0, 0, 0, 0, 0, null, 0L, 0, 0, null);
            forceAtomEntry.setOid(player.getMap().getSpawnedForcesOnMap());
            forceAtomEntry.setColor(1);
            forceAtomEntry.setFirstImpactMin(Randomizer.rand(entry.getFirstImpactMin(), entry.getFirstImpactMax()));
            forceAtomEntry.setFirstImpactMax(Randomizer.rand(entry.getSecondImpactMin(), entry.getSecondImpactMax()));
            forceAtomEntry.setSecondImpactMin(Randomizer.rand(20, 45));
            forceAtomEntry.setSecondImpactMax(1000);
            forceAtomEntry.setPoint(new Point((mob.getPosition()).x - (player.getPosition()).x, (mob.getPosition()).y - (player.getPosition()).y));
            forceAtomEntry.setCreatTime(System.currentTimeMillis());
            forceAtomEntry.setMobCount(0);
            forceAtomEntry.setY(0);
        }

        return ret;
    }

    
    public final MapleForceAtom createForceList( MapleCharacter player,  MapleStatEffect effect,  List<Integer> list,  List points) {
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(effect, "effect");
        Intrinsics.checkParameterIsNotNull(list, "list");
        Intrinsics.checkParameterIsNotNull(points, "points");
        MapleForceAtom t = new MapleForceAtom(false, 0, 0, 0, 0, 0, (List) null, (Rectangle) null, 0, (Point) null, (List) null, 0);
        t.setOwnerID(player.getId());
        t.setType(effect.getSourceid() == 155111207 ? 48 : 23);
        t.setToMobOID(0);
        t.setToMobOIDs(list);
        t.setSkillID(effect.getSourceid());
        ArrayList list3 = new ArrayList();
        Map map = (Map) forceAtoms.get(effect.getSourceid() == 155111207 ? 48 : 23);
        ForceAtomDataEntry k = map != null ? (ForceAtomDataEntry) map.get(Math.min(map.size(), (effect.getSourceid() == 22170070 ? 2 : (effect.getSourceid() == 155111207 ? 0 : 1)) + 1)) : null;
        if (map != null && k != null) {
            Iterable $receiver$iv = (Iterable) points;
            Iterator var10 = $receiver$iv.iterator();

            while (var10.hasNext()) {
                Object element$iv = var10.next();
                Point it = (Point) element$iv;
                ForceAtomEntry forceAtomEntry = new ForceAtomEntry(0, 0, 0, 0, 0, 0, (Point) null, 0L, 0, 0, (Point) null);
                forceAtomEntry.setOid(player.getMap().getSpawnedForcesOnMap());
                forceAtomEntry.setColor(effect.getSourceid() == 22170070 ? 2 : (effect.getSourceid() == 155111207 ? 0 : 1));
                forceAtomEntry.setFirstImpactMin(Randomizer.rand(k.getFirstImpactMin(), k.getFirstImpactMax()));
                forceAtomEntry.setFirstImpactMax(Randomizer.rand(k.getSecondImpactMin(), k.getSecondImpactMax()));
                forceAtomEntry.setSecondImpactMin(Randomizer.rand(64, 79));
                forceAtomEntry.setSecondImpactMax(512);
                forceAtomEntry.setPoint(it);
                forceAtomEntry.setCreatTime(System.currentTimeMillis());
                forceAtomEntry.setMobCount(1);
                forceAtomEntry.setY(0);
                list3.add(forceAtomEntry);
            }

            Point var16;
            for (var10 = points.iterator(); var10.hasNext(); var16 = (Point) var10.next()) {
            }
        }

        t.setForceAtomEntry((List) list3);
        return t;

    }

    
    public final List<ForceAtomEntry> createForceList( MapleCharacter player,  MapleStatEffect effect,  List points, int x) {
        Iterator iterator;
        Intrinsics.checkParameterIsNotNull(player, "player");
        Intrinsics.checkParameterIsNotNull(effect, "effect");
        Intrinsics.checkParameterIsNotNull(points, "points");
        ArrayList<ForceAtomEntry> ret = new ArrayList();
        Map forceAtomData = forceAtoms.get(Integer.valueOf(23));
        if (forceAtomData != null) {
            ForceAtomDataEntry entry = (ForceAtomDataEntry) forceAtomData.get(Integer.valueOf(Math.min(forceAtomData.size(), ((effect.getSourceid() == 22170070) ? 2 : 1) + 1)));
            if (entry != null)
                /* 812 */ {
                Iterable $receiver$iv = points;
                iterator = $receiver$iv.iterator();
            } else {
                return ret;
            }
        } else {
            return ret;
        }
        if (iterator.hasNext()) {
            Object element$iv = iterator.next();
            Point it = (Point) element$iv;

            ForceAtomEntry forceAtomEntry = new ForceAtomEntry(0, 0, 0, 0, 0, 0, null, 0L, 0, 0, null);

            forceAtomEntry.setOid(player.getMap().getSpawnedForcesOnMap());
        }


        return ret;
    }


}